﻿using MxWeiXinPF.Common;
using MxWeiXinPF.Web.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MxWeiXinPF.Web.weixin.jiaoshuifei
{
    public partial class index : WeiXinPage
    {
        /// <summary>
        /// ErrLevel:100表示正确无误，1表示严重错误，2表示业务方面有问题;3直接跳转到结束页面
        /// </summary>
        public int ErrLevel = 100;
        public string ErrorInfo = "";
        public int wid =0;

        protected void Page_Load(object sender, EventArgs e)
        {
            wid = MyCommFun.RequestWid();

            string thisUrl = MyCommFun.getWebSite() + "/weixin/jiaoshuifei/index.aspx?wid=" + wid;
            OAuth2BaseProc(wid, thisUrl);
            jssdkInit(wid, thisUrl);

            if ( wid == 0 || openid == "")
            {
                ErrLevel = 1;
                ErrorInfo = "访问参数错误！";
                return;
            }
            BindData(wid);


        }

        private void BindData(int wid)
        {
            MxWeiXinPF.BLL.shuifei_baseinfo bll = new MxWeiXinPF.BLL.shuifei_baseinfo();
            MxWeiXinPF.Model.shuifei_baseinfo model = bll.GetModelByWid(wid);
            imgBg.ImageUrl = model.index_bg_pic!=null?model.index_bg_pic.ToString(): "/weixin/jiaoshuifei/images/ZaFZJHUU7z.jpg";

        }
    }
}